package com.qf.bank.employeeapi.api;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.bank.employeeapi.fallback.EmployeeApiError;
import com.qf.bank.employeeapi.po.Info;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: 李成浩
 * @Date: 2019/12/7 11:32
 */
@FeignClient(value = "employee-provider", fallback = EmployeeApiError.class)
public interface EmployeeApi {
        /**
         *@auther 李成浩
         *@param current, size
         *@return org.springframework.data.domain.Page<com.qf.bank.employeeapi.po.Info>
         *@date 2019/12/7 14:48
         * 员工分页
         */
        @RequestMapping(value = "/", method = RequestMethod.GET)
        Page<Info> page(@RequestParam int current, @RequestParam int size);

        /**
         *@auther 李成浩
         *@param
         *@return com.qf.bank.employeeapi.po.Info
         *@date 2019/12/7 14:47
         * 查询单个用户
         */
        @RequestMapping(value = "/{jobNumber}", method = RequestMethod.GET)
        Info getById(@PathVariable(value = "jobNumber") int jobNumber);
        /**
         *@auther 李成浩
         *@param
         *@return com.qf.bank.employeeapi.po.Info
         *@date 2019/12/7 14:47
         * 员工登录验证,---------------------注意
         * 向服务器提交数据
         */
        @RequestMapping(value = "/LoginTwo", method = RequestMethod.POST)
        Info getSelectLogin(@RequestBody Info info);

        /**
         *@auther 李成浩
         *@param  info
         *@return
         *@date 2019/12/7 14:32
         * 添加一个员工
         */
        @RequestMapping(value = "/insert",method = RequestMethod.POST)
         boolean insert(@RequestBody Info info );

        /**
         *@auther 李成浩
         *@param  * @param null
         *@return
         *@date 2019/12/7 16:19
         * 根据id删除一个员工
         */
        @RequestMapping(value = "/{jobNumber}", method = RequestMethod.DELETE)
         boolean getDeleteId(@PathVariable(value = "jobNumber") int jobNumber);

        /**
         *@auther 李成浩
         *@param  * @param null
         *@return
         *@date 2019/12/7 16:25
         * 删除多个用户
         */
        @RequestMapping(value = "/",method = RequestMethod.DELETE)
        Boolean getDelete(@RequestBody List<Integer> list);

        /**
         *@auther 李成浩
         *@param  * @param null
         *@return
         *@date 2019/12/7 16:28
         * 根据id修改信息(修改部分信息)
         */
        @RequestMapping(value = "/", method = RequestMethod.PATCH)
         Boolean getChangeId(@RequestBody Info info);


}
